package com.qf.day61.service.impl;

import com.qf.day61.dao.CategoryDAO;
import com.qf.day61.entity.Category;
import com.qf.day61.service.CategoryService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {
    private final CategoryDAO categoryDAO;

    public CategoryServiceImpl(CategoryDAO categoryDAO) {
        this.categoryDAO = categoryDAO;
    }

    @Override
    public List<Category> findAll() {
        return categoryDAO.findAll();
    }

    @Override
    public Category findById(Integer categoryId) {
        return categoryDAO.findById(categoryId);
    }
}
